package com.tql.mall.model.enums.customer;

import lombok.Getter;

@Getter
public enum CustRegiFailEnum {

    FAIL_ACCOUNT_REPEATED(1,"该账号名已经被使用了！"),
    FAIL_PASSWD_DIFFERNET(2,"两次填写的密码不一致！"),
    FAIL_CODE_ERROR(3,"验证码错误或失效"),
    FAIL_PHONE_USED(4,"该手机号已被注册"),
    FAIL_INFO_INCOMPLET(5,"注册信息填写不完整！"),
    ;
    private Integer status;
    private String msg;
    CustRegiFailEnum(Integer status,String msg){
        this.status = status;
        this.msg = msg;
    }

    public static String getStatusNameByStatus(Integer status){
        CustRegiFailEnum[] values = CustRegiFailEnum.values();
        for (CustRegiFailEnum value : values){
            if (status.intValue() == value.getStatus().intValue()){
                return value.getMsg();
            }
        }
        return "";
    }
}
